from packages.View import Views
from packages.Controller import Controller

class Main():
    def __init__(self):
        view = Views()

        ctrlobj = Controller()

        while True:
            num = input("请选择您所需交易：")

            code = ['0','1','2','3','4','5','6','7','8','9']
            if num not in code:
                continue
            if num == '0':
                ctrlobj.save()
            elif num == '1':
                ctrlobj.register()
            elif num == '2':
                ctrlobj.query()
            elif num == '3':
                ctrlobj.add_money()
            elif num == '4':
                ctrlobj.get_money()
            elif num == '5':
                ctrlobj.transfor_money()
            elif num == '6':
                ctrlobj.change_pwd()
            elif num == '7':
                ctrlobj.lock()
            elif num == '8':
                ctrlobj.unlock()
            elif num == '9':
                ctrlobj.recreate_card()

if __name__ == "__main__":
    Main()
